package com.sztx.pay.center.rpc.api.service;

import java.util.Date;
import java.util.List;

import com.sztx.pay.center.rpc.api.domain.PageModelResponse;
import com.sztx.pay.center.rpc.api.domain.QueryHbaseOrderResp;
import com.sztx.pay.center.rpc.api.domain.UserAmountCollectResponse;
import com.sztx.pay.center.rpc.api.domain.request.QueryHbaseOrderRequest;
import com.sztx.pay.center.rpc.api.domain.request.QueryOrderCallback;
import com.sztx.pay.center.rpc.api.domain.request.QueryOrderRequest;
import com.sztx.pay.center.rpc.api.domain.request.QueryOrderSettle;
import com.sztx.pay.center.rpc.api.domain.request.QueryUserAccountFlow;
import com.sztx.pay.center.rpc.api.domain.response.OrderB2C;
import com.sztx.pay.center.rpc.api.domain.response.OrderB2CList;
import com.sztx.pay.center.rpc.api.domain.response.OrderCallbackList;
import com.sztx.pay.center.rpc.api.domain.response.OrderRecharge;
import com.sztx.pay.center.rpc.api.domain.response.OrderRechargeList;
import com.sztx.pay.center.rpc.api.domain.response.OrderRefund;
import com.sztx.pay.center.rpc.api.domain.response.OrderRefundList;
import com.sztx.pay.center.rpc.api.domain.response.OrderSettleList;
import com.sztx.pay.center.rpc.api.domain.response.OrderTransfer;
import com.sztx.pay.center.rpc.api.domain.response.OrderTransferList;
import com.sztx.pay.center.rpc.api.domain.response.OrderWithdraw;
import com.sztx.pay.center.rpc.api.domain.response.OrderWithdrawList;
import com.sztx.pay.center.rpc.api.domain.response.PayFlowList;
import com.sztx.pay.center.rpc.api.domain.response.QueryOrderStateResponse;
import com.sztx.pay.center.rpc.api.domain.response.UserActFlowList;

public interface QueryService {

	/**
	 * 查询B2C交易数据,仅一条
	 * 
	 * @param request 查询条件
	 * @return 没查到返回null
	 */
	OrderB2C findOneB2C(QueryOrderRequest request);

	/**
	 * 查询B2C交易数据总数
	 * 
	 * @param request
	 *            查询条件
	 * @return
	 */
	int findB2CCount(QueryOrderRequest request);
	
	/**
	 * 查询B2C交易数据
	 * 
	 * @param request
	 *            查询条件
	 * @return
	 */
	OrderB2CList findB2C(QueryOrderRequest request, Integer pageNo, Integer pageSize);
	
	/**
	 * 查询充值数据,仅一条
	 * 
	 * @param request
	 * @return 没查到返回null
	 */
	 OrderRecharge findOneRecharge(QueryOrderRequest request);
	
	/**
	 * 查询充值数据总数
	 * 
	 * @param request
	 * @return
	 */
	 int findRechargeCount(QueryOrderRequest request);
		
	/**
	 * 查询充值数据
	 * 
	 * @param request
	 * @return
	 */
	 OrderRechargeList findRecharge(QueryOrderRequest request, Integer pageNo, Integer pageSize);
	
	/**
	 * 查询退款数据,仅一条
	 * 
	 * @param request
	 * @return 没查到返回null
	 */
	OrderRefund findOneRefund(QueryOrderRequest request);
	
	/**
	 * 查询退款数据总数
	 * 
	 * @param request
	 * @return
	 */
	int findRefundCount(QueryOrderRequest request);
	
	/**
	 * 查询退款数据
	 * 
	 * @param request
	 * @return
	 */
	OrderRefundList findRefund(QueryOrderRequest request, Integer pageNo, Integer pageSize);

	/**
	 * 查询转账数据,仅一条
	 * 
	 * @param request
	 * @return 没查到返回null
	 */
	OrderTransfer findOneTransfer(QueryOrderRequest request);

	/**
	 * 查询转账数据总数
	 * 
	 * @param request
	 * @return
	 */
	int findTransferCount(QueryOrderRequest request);
	
	/**
	 * 查询转账数据
	 * 
	 * @param request
	 * @return
	 */
	OrderTransferList findTransfer(QueryOrderRequest request, Integer pageNo, Integer pageSize);

	/**
	 * 查询提现数据,仅一条
	 * 
	 * @param request
	 * @return 没查到返回null
	 */
	OrderWithdraw findOneWithdraw(QueryOrderRequest request);

	/**
	 * 查询提现数据总数
	 * 
	 * @param request
	 * @return
	 */
	int findWithdrawCount(QueryOrderRequest request);
	
	/**
	 * 查询提现数据
	 * 
	 * @param request
	 * @return
	 */
	OrderWithdrawList findWithdraw(QueryOrderRequest request, Integer pageNo, Integer pageSize);

	/**
	 * 查询支付流水数据，根据提供的tradeOrderNo
	 * 
	 * @param request
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	PayFlowList findPayFlow(QueryOrderRequest request, Integer pageNo, Integer pageSize);

	/**
	 * 查询订单回调信息
	 * 
	 * @param request
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	OrderCallbackList findOrderCallback(QueryOrderCallback request, Integer pageNo, Integer pageSize);
	
	/**
	 * 查询订单结算记录
	 * 
	 * @param request
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	OrderSettleList findSettleOrder(QueryOrderSettle request, Integer pageNo, Integer pageSize);
	
	/**
	 * 查询账户流水
	 * 
	 * @param request
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	UserActFlowList findAccountFlow(QueryUserAccountFlow request, Integer pageNo, Integer pageSize);
	
	/**
	 * 根据一个B2C订单的订单号查询对应它的退款详情(为了不破坏上面通用的入参实体，因此写了这个方法)
	 * 
	 * @param request
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	OrderRefundList findB2CRefundDetail(String tradeOrderNo);
	
	QueryHbaseOrderResp findOrderFromHbase(QueryHbaseOrderRequest request, Integer pageSize);
	
	/**
	 * @param tradeOrderNo
	 * @param extendType 1:detail,2:payFlow,3:callback,4:actFlow,5:settle
	 * @return
	 */
	List<String> findOrderExtend(String tradeOrderNo, int extendType);
	
	
	PageModelResponse<UserAmountCollectResponse> queryAmountCollect(Date startDate,Date endDate,int pageNo,int pageSize);
	
	QueryOrderStateResponse queryOrderState(String tradeOrderNo);
	
}
